package map;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

public class MapMain {

	public static void main(String[] args) {
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		map.put("Encen", 5);
		map.put("Mazhaung", 4);

		printValue(map, "Encen");
		printValue(map, "Mazhaung");
		printValue(map, "Tom");

		for (Entry<String, Integer> entry : map.entrySet()) {
			System.out.println("key:" + entry.getKey() + " value:" + entry.getValue());
		}
	}

	public static void printValue(Map map, Object key) {
		if (map.containsKey(key)) {
			System.out.println("Use key:" + key + " find value:" + map.get(key));
		} else {
			System.out.println("Does not contain key:" + key);
		}
	}

}
